package com.wangx1n;

import com.wangx1n.config.SpringConfig;
import com.wangx1n.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author WangXin
 * @date 2020/12/4 10:08
 */
public class myTest {
    @Test
    public void AnnotationConfigTest(){
        //通过注解获得bean配置信息
        ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);
        UserService userService = context.getBean("userService", UserService.class);
        userService.getUserDao().getUserInfo();
    }
}
